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

Query time 0.00048