UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OVfTMljZ4O67PVFzgMe7ETbv1kueoIh5GL9fFQipu14='
WHERE
key_id = 'b6674d1e551b199a95007cfe5cc2779a6c9c1e700aa01536b08d88bb4927738e'
AND (
token = 'OVfTMljZ4O67PVFzgMe7ETbv1kueoIh5GL9fFQipu14='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)