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

Query time 0.00033