UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bw/J1PcSNJZuoy6XBzNPsQPiQuRnVhQ6hWIpl/BKrxM=' 
WHERE 
  key_id = 'e1f754f94a412da56cebfcf32c93f1bf34e736f5775b84a1a9866084aa858608' 
  AND (
    token = 'bw/J1PcSNJZuoy6XBzNPsQPiQuRnVhQ6hWIpl/BKrxM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041