UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TjoYdrIrjOIw0Prgf/eay1o7Nkq8bncfDVUkGAuL2X4=' 
WHERE 
  key_id = '5be9b4f12615a8145da776ac170af03edafbb7cf946e12c2d908c898b130d97c' 
  AND (
    token = 'TjoYdrIrjOIw0Prgf/eay1o7Nkq8bncfDVUkGAuL2X4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019