UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OZKm+XrapkuKR3cg65bCLjNtI60hDC5+02MqDN5txx0='
WHERE
key_id = '7c9fb326e38eb283c2eb5fa8d62bacf1e1ed49d6b9c5a4d3e9d83f0349062aa9'
AND (
token = 'OZKm+XrapkuKR3cg65bCLjNtI60hDC5+02MqDN5txx0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)