UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PMUX6IgLh8+YY1MZs0hNEs7IRJd50ORHeVBieiYrga8='
WHERE
key_id = '6ca9032c13540cdfea837bad5362f5cf2373ad5b10ef1f9b054cd7f856501397'
AND (
token = 'PMUX6IgLh8+YY1MZs0hNEs7IRJd50ORHeVBieiYrga8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)