UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TjOx8rnEnFk3Z5R7mrzy8dVW5bjR03teWPR1Ovk5bbw=' 
WHERE 
  key_id = '714f32bdf5f20b1bb3f8eda97bab44f90b5820f715ca3db95b357902e6ac1d1f' 
  AND (
    token = 'TjOx8rnEnFk3Z5R7mrzy8dVW5bjR03teWPR1Ovk5bbw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035