UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Px9iKLs6uUVMrtt+F4779+DeiZY9HV1La1uH/PwiUd8='
WHERE
key_id = 'c05e48251587810357f3dbeb408fdfb74ce3ff4b6006a18ce78eb0e13237aadb'
AND (
token = 'Px9iKLs6uUVMrtt+F4779+DeiZY9HV1La1uH/PwiUd8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)