UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Do3SgOQUKkwGN/Tojegq5UV3SYm/047mXpPJrQh7gY='
WHERE
key_id = '3a265b7dd35288accbcf5d2642050c2347b63ab483c5c3c945c5b4833a8e5ae4'
AND (
token = '/Do3SgOQUKkwGN/Tojegq5UV3SYm/047mXpPJrQh7gY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)