UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lNwYbbe/pXoWudI2jiVD7zR+b7DSg9kYbRIXvZwvwB4='
WHERE
key_id = 'a29aac93c17d927ab76917fd4a34ac2631b5c1e0e4ae172b2b497c34fc0c93d5'
AND (
token = 'lNwYbbe/pXoWudI2jiVD7zR+b7DSg9kYbRIXvZwvwB4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)