UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QhBOA2kzDauVmaNpzGN0xXyUW2BIk3qL0eexrpP7NjA='
WHERE
key_id = '9fedf707af19e621e2930c2fc27a1fead24014c1c25afd3679b893f3341e0f69'
AND (
token = 'QhBOA2kzDauVmaNpzGN0xXyUW2BIk3qL0eexrpP7NjA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)