UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DyakC3VF0iB/kH4zjFUQI4gDgsfj+ZyWcGZcsUbl9dI='
WHERE
key_id = 'b68079028ea13542aba9adb6d15ba3dfe5d5114f26faeb16afcca40daaa8f0df'
AND (
token = 'DyakC3VF0iB/kH4zjFUQI4gDgsfj+ZyWcGZcsUbl9dI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)