UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '78ootmgnzkeyQhvJGzr4jMSJcRW7c7PJQKbTa4pCJeU='
WHERE
key_id = '3d0ba79bcca1efa1dcf3222041d9a640fa670030bf449334b183a1fc9c4f0de2'
AND (
token = '78ootmgnzkeyQhvJGzr4jMSJcRW7c7PJQKbTa4pCJeU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)