UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5dEcndiCxKqbQH2kKsRlhxUGlITo6Tj7ad+ryoaklCk=' 
WHERE 
  key_id = 'd70dab7677f8e1e642bd27eed66c1b1b7b4de26b4575bae89e8c1c6077b2eec9' 
  AND (
    token = '5dEcndiCxKqbQH2kKsRlhxUGlITo6Tj7ad+ryoaklCk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045