UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TG6UjNrXnBNW2//+AY7VarH3/X+vjXry2c5eEWhDxjU='
WHERE
key_id = 'e5dd126459f478b975358d4760422461eea552edd90368d4932736ef854da3e0'
AND (
token = 'TG6UjNrXnBNW2//+AY7VarH3/X+vjXry2c5eEWhDxjU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)