UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wm6RWw9iXXfjo3VY8afC2gtezGDjR9ZJcCk8Zhdyaig='
WHERE
key_id = '808dc5393336b9da0ccfb7e2d70b9f76524ced7a444f7b1b31e97e65bc83180a'
AND (
token = 'wm6RWw9iXXfjo3VY8afC2gtezGDjR9ZJcCk8Zhdyaig='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)