UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LJNQyM61+QzM24m68KjHogWVSCeWn0kyaDqzQPjBniI='
WHERE
key_id = '3a9bf762003a1c832391c98d21213bfb51a0cd23036b881aadd2cb93f6a055b8'
AND (
token = 'LJNQyM61+QzM24m68KjHogWVSCeWn0kyaDqzQPjBniI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)