UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u62MD9siskYIQWjHs69wyHWaLD5dZewljDqPPDgX+lE='
WHERE
key_id = '9bbcae6736a8529eb6b156acff6dc95ab8ca186e8f0b3434459ccef6a2898651'
AND (
token = 'u62MD9siskYIQWjHs69wyHWaLD5dZewljDqPPDgX+lE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)