UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6H7aswDWhE0F7RUhCmuL4cN17r9/O9JuBA0h+JI3IyM=' 
WHERE 
  key_id = '0088e22b1bc4f919f894fe2de16f8aa9b8222b116b29eb61e5ff71dc4d9f4f79' 
  AND (
    token = '6H7aswDWhE0F7RUhCmuL4cN17r9/O9JuBA0h+JI3IyM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040