UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jPCiQRqkiAhYdYxxjKzSm5VJlkHGCI7QhWUO5a/R8GI='
WHERE
key_id = 'af3d8ddaad46f73dc81f8e3da4ecdc4ec467ac3544a112ca0025d81de457d50a'
AND (
token = 'jPCiQRqkiAhYdYxxjKzSm5VJlkHGCI7QhWUO5a/R8GI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)