UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lZ/3OVgyd9Sy1ryVt0oZig4f61hw0jFo3WIHnf+OKTw='
WHERE
key_id = 'd1e29d36b59118a1558c7380d95a007ebcce9ca1274d5ca78f8d02f4c0a83a50'
AND (
token = 'lZ/3OVgyd9Sy1ryVt0oZig4f61hw0jFo3WIHnf+OKTw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)