UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xf+XaRAUDjwrAJY9xzNPjeIvoGLS+OwL68+nJfKGKpQ='
WHERE
key_id = 'eed46c5ebd743e94b4aad179e8c21a555cdbf790a4c5b34bf11d96561f10642b'
AND (
token = 'xf+XaRAUDjwrAJY9xzNPjeIvoGLS+OwL68+nJfKGKpQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)