UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2L7A1jhXOosr9lgzzZPP6+HZcotuGReYWgQwmqC9p3c='
WHERE
key_id = 'e380fe8423457590c1b8c0e095b687828caf36bf0cdb7fad2d70d35e42fc83d1'
AND (
token = '2L7A1jhXOosr9lgzzZPP6+HZcotuGReYWgQwmqC9p3c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)