UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QVFxcbkFC3LqGb7RCnV+PX5o0fx14ReKB5JaMNwbUsI='
WHERE
key_id = 'd9d7d63a3451354a5c0625d143f976db3697a18a2ed53bb524b9d0510b783b74'
AND (
token = 'QVFxcbkFC3LqGb7RCnV+PX5o0fx14ReKB5JaMNwbUsI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)