UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/McaUoxBey+Z+yQHuaGvO6T9GykQVfLkVGcJmVXf2bA='
WHERE
key_id = '0ec7e3eddaa44d829aeb2fe4092c678c9f49cf00c62b18c7dba2d2a4dae5547e'
AND (
token = '/McaUoxBey+Z+yQHuaGvO6T9GykQVfLkVGcJmVXf2bA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)