UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'npEkYjkEGnpQwdVI7343iU7yCS0KAdLPdBujy31Zptw=' 
WHERE 
  key_id = '55a2c68b25e6ea24e9231f3016d6c60cac38c40ccc072049f93ae9065ae92f41' 
  AND (
    token = 'npEkYjkEGnpQwdVI7343iU7yCS0KAdLPdBujy31Zptw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037