UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1FnGFFZR6MFq4M9AQ0TdPNw13DITRNtTzU6Q29lIH+Y='
WHERE
key_id = '783434d454c548b4986ed803f7df9eb3696227ed530b53952badfa1f2f211ab5'
AND (
token = '1FnGFFZR6MFq4M9AQ0TdPNw13DITRNtTzU6Q29lIH+Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)