UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'abVBPj3S/fMz9TvmbHRCWpp2ta+0ISz5MdbErnCVPCM=' 
WHERE 
  key_id = '86ab412d32377182965cad5fb8ae91986f3fdfab179ec273bf70e6a08342cf28' 
  AND (
    token = 'abVBPj3S/fMz9TvmbHRCWpp2ta+0ISz5MdbErnCVPCM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031