UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WrlfE9l+AdwDV/NWsH2E3c52cH03SYyVwEZLPWAAvPc=' 
WHERE 
  key_id = '7f20229ee55f0fd0aef3faad2c148cc31339210ee6d0a4ca20875993861ed19f' 
  AND (
    token = 'WrlfE9l+AdwDV/NWsH2E3c52cH03SYyVwEZLPWAAvPc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042