UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aG2+kotgjK4zj6o9tmBL9oYqbOGVNUIEFozqVjKmCXY='
WHERE
key_id = 'c88838c54b8ffd6cd0395402611d8b176fa01a60d1ef1c7f8ddca8c4ac37b3c3'
AND (
token = 'aG2+kotgjK4zj6o9tmBL9oYqbOGVNUIEFozqVjKmCXY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)