UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yz/nPdyJXAd+LaDg6oFpAAjzlxYuyy00hognhYWsPTw='
WHERE
key_id = '02faff12ee493cc7267fa671c2bca420e096681e39ee42f50b11a7409bc2d2a6'
AND (
token = 'yz/nPdyJXAd+LaDg6oFpAAjzlxYuyy00hognhYWsPTw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)