UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TTFtojSoPSDDiwJgYqwuuhcizA4VWI1sNYRFakcEJZg=' 
WHERE 
  key_id = '64d4dcf6a27c6d8e956161a28864df630c55ee49a405e678a1f005e1bc18adc7' 
  AND (
    token = 'TTFtojSoPSDDiwJgYqwuuhcizA4VWI1sNYRFakcEJZg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00598