UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GIICsil4HWDr0OsTEG9+gJvEjmicRKNoESophj9Xxfs='
WHERE
key_id = '4c10d6905f6e463ff327fa48987dd4e598a4934fd2f04f95dffbf10ef359fc15'
AND (
token = 'GIICsil4HWDr0OsTEG9+gJvEjmicRKNoESophj9Xxfs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)