UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RarGPJJnWMdK70PIGf3b7cMxiHpEVvE6GGHgqiHvTs0='
WHERE
key_id = '1df808dfd20b74254639e3ccfa6a0d2143ea39635485f2d47238cff2bd7e9b94'
AND (
token = 'RarGPJJnWMdK70PIGf3b7cMxiHpEVvE6GGHgqiHvTs0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)