UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T7uPuVhHY6xx3bSUwLBvkFIS3keyvhMFcGtM/ofR4CI=' 
WHERE 
  key_id = '9ba59bab1879a6f9eb7a7ea468ef16bed63f908cff26dab6e20bfd40b11d0ae9' 
  AND (
    token = 'T7uPuVhHY6xx3bSUwLBvkFIS3keyvhMFcGtM/ofR4CI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041