UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '13BJm9McIniKuPGEbdsmogi95N+1psfNUQgpQZX0YGM=' 
WHERE 
  key_id = '883b78791862689feddc2b912affececa0105d8f8782f24a921e72da6d7eff7b' 
  AND (
    token = '13BJm9McIniKuPGEbdsmogi95N+1psfNUQgpQZX0YGM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028